package com.tcps.wechat_push.controller;

import com.tcps.wechat_push.constant.Message;
import com.tcps.wechat_push.constant.ReturnCode;
import com.tcps.wechat_push.service.impl.WeChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author greenlee
 * @version v1.0
 * @create 创建时间: 2018-07-17 17:23
 * Copyright 2018  by 三水林科技有限公司
 **/
@RestController
@RequestMapping("/wechat")
public class WeChatController {

    @Autowired
    private WeChatService weChatService;

    @PostMapping(value = "/set",produces = "application/json; charset=UTF-8")
    public Map<String, Object> setPushPlanBusshiftBus(@RequestParam("time")String time){
        String a =time;
        weChatService.pushPlanBusshiftBus();
        Map<String, Object> message = new HashMap<>();
        message.put(Message.RETURN_FIELD_CODE, ReturnCode.SUCCESS);
        return message;
    }
    @GetMapping(value = "/get")
    public Map<String, Object> setPushPlanBusshiftBus(){
//        List list = weChatService.queryPlan();
        weChatService.pushPlanBusshiftBus();
        Map<String, Object> message = new HashMap<>();
        message.put(Message.RETURN_FIELD_CODE, ReturnCode.SUCCESS);
        return message;
    }

}
